/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MenuPrincipal.java
 *
 * Created on 23/06/2010, 08:12:00 PM
 */

package CapaGrafica;
import CapaLogica.ManejoXML;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import ve.edu.ucab.server.logica.Servidor;

/**
 *
 * @author Maria
 */
public class MenuPrincipal extends javax.swing.JFrame {

    /** Creates new form MenuPrincipal */
    public MenuPrincipal() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jBrestaurantes = new javax.swing.JButton();
        jBreservacion = new javax.swing.JButton();
        jBreportes = new javax.swing.JButton();
        jBnomina = new javax.swing.JButton();
        jBingresarUsuario = new javax.swing.JButton();
        jBhabitaciones = new javax.swing.JButton();
        jBconsultarReserva = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jBrestaurantes.setText("Restaurantes");
        jBrestaurantes.setName("jBrestaurantes"); // NOI18N

        jBreservacion.setText("Reservaciones");
        jBreservacion.setName("jBreservacion"); // NOI18N

        jBreportes.setText("Reportes");
        jBreportes.setName("jBreportes"); // NOI18N
        jBreportes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBreportesActionPerformed(evt);
            }
        });

        jBnomina.setText("Nomina");
        jBnomina.setName("jBnomina"); // NOI18N

        jBingresarUsuario.setText("Ingresar usuario");
        jBingresarUsuario.setName("jBingresarUsuario"); // NOI18N
        jBingresarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBingresarUsuarioActionPerformed(evt);
            }
        });

        jBhabitaciones.setText("Habitaciones");
        jBhabitaciones.setName("jBhabitaciones"); // NOI18N
        jBhabitaciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBhabitacionesActionPerformed(evt);
            }
        });

        jBconsultarReserva.setText("Consultar reserva");
        jBconsultarReserva.setName("jBconsultarReserva"); // NOI18N

        jSeparator1.setName("jSeparator1"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(158, 158, 158)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jBconsultarReserva, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBhabitaciones, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBingresarUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBnomina, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBreportes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBreservacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBrestaurantes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(152, Short.MAX_VALUE))
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(34, Short.MAX_VALUE)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jBconsultarReserva)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBhabitaciones)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBingresarUsuario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBnomina)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBreportes)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBreservacion)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBrestaurantes)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBhabitacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBhabitacionesActionPerformed
        ListadoHabitaciones ventana = new ListadoHabitaciones();
        ventana.setVisible(true);
        this.setVisible(false);// TODO add your handling code here:
    }//GEN-LAST:event_jBhabitacionesActionPerformed

    private void jBreportesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBreportesActionPerformed
       GestionReportes ventana = new GestionReportes();
        ventana.setVisible(true);
        this.setVisible(false); // TODO add your handling code here:
    }//GEN-LAST:event_jBreportesActionPerformed

    private void jBingresarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBingresarUsuarioActionPerformed
       ListaClientes ventana = new ListaClientes();
        this.setVisible(false);
        ventana.setVisible(true); // TODO add your handling code here:
    }//GEN-LAST:event_jBingresarUsuarioActionPerformed

    /**
    * @param args the command line arguments
    */
   public static void main(String[] args)
    {
        System.out.print("Cargando xml... ");
        ManejoXML.cargarDatos();
        System.out.println("listo!");

//        System.out.print("Guardando xml... ");
//        ManejoXML.guardarDatos();
//        System.out.println("listo!");
//
//        String[] parametros = {"7687", "CapaLogica.ComunicacionCliente"};
//        Servidor.main(parametros);

        //Se obtiene el "look & feel" del S.O. y se le asigna el mismo a la aplicacion
        try
        {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch (UnsupportedLookAndFeelException e) {}
        catch (ClassNotFoundException e) {}
        catch (InstantiationException e) {}
        catch (IllegalAccessException e) {}

        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MenuPrincipal().setVisible(true);
            }
        });
    }



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBconsultarReserva;
    private javax.swing.JButton jBhabitaciones;
    private javax.swing.JButton jBingresarUsuario;
    private javax.swing.JButton jBnomina;
    private javax.swing.JButton jBreportes;
    private javax.swing.JButton jBreservacion;
    private javax.swing.JButton jBrestaurantes;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables

        }